package org.shiki.hrm.page;

import lombok.Data;
import org.shiki.hrm.vo.AggVo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

//分页对象：easyui只需两个属性，total(总数),datas（分页数据）就能实现分页
@Data
public class PageList<T> {
    private long total;
    private List<T> rows = new ArrayList<>();
    private Map<String, List<AggVo>> map = new HashMap<>();

    public PageList(long total, List<T> rows, Map<String, List<AggVo>> map) {
        this.total = total;
        this.rows = rows;
        this.map = map;
    }
    //提供有参构造方法，方便测试
    public PageList(long total, List<T> rows) {
        this.total = total;
        this.rows = rows;
    }
    //除了有参构造方法，还需要提供一个无参构造方法
    public PageList() {
    }
}
